package com.okamura;

import com.okamura.service.ResponseInfoService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@SpringBootApplication
@MapperScan("com.okamura.mapper")
public class MerroClientApplication {

    public static void main(String[] args) throws InterruptedException, IOException {
        SpringApplication.run(MerroClientApplication.class, args);
        //获取配置文件中的端口信息
        Properties properties = new Properties();
        InputStream resource = MerroClientApplication.class.getClassLoader().getResourceAsStream("application.properties");
        properties.load(resource);
        String merroHost = properties.getProperty("MERRO.HOST");
        int merroPort = Integer.parseInt(properties.getProperty("MERRO.PORT"));
        new ResponseInfoService(merroHost, merroPort).start();
    }

}
